#include<bits/stdc++.h>
using namespace std;
char number[300]={' '},name[300]={' '};
int a[10000],b[10000],c[10000],sum[10000]={0};
const int INF=0x3f3f3f3f;
int main()
{
	int n,i,sa=0,sb=0,sc=0,mx=-INF,t,j=1,t2=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>number[i]>>name>>a[i]>>b[i]>>c[i];
		number[strlen(number)]=' ';
		name[strlen(name)]=' ';
		sum[i]=a[i]+b[i]+c[i];
		sa=sa+a[i];	
		sb=sb+b[i];	
		sc=sc+c[i];	
		if(mx<sum[i])
		{
			mx=sum[i];
			t=i;
		}
	}
	for(i=1;i<=n;i++)
	{
		
	}
	printf("%f %f %f\n",sa*1.0/n,sb*1.0/n,sc*1.0/n);
	for(i=0;t2<t;i++)
	{
		printf("%c",number[i]);
		if(number[i]==' ') t2++;
	}
	cout<<" ";
	t2=0;
	for(i=0;t2<t;i++)
	{
		printf("%c",name[i]);
		if(name[i]==' ') t2++;
	}
	cout<<" ";
	printf("%d %d %d",a[t],b[t],c[t]);
	return 0;
}
